import Item from 'antd-mobile/es/components/dropdown/item'
import React,{useState,useEffect} from 'react'
import { getAuthorList } from "../../../components/api"
import "../../public/public.css"
interface Author{
 
  [propName:string]:any
  
}
export default function Author() {
    const [Author, setAuthor] = useState<Author[]>([])
    
    const getAuthor = () => {
        getAuthorList().then(res => {
            // console.log(res,"123456");
          setAuthor(res.data)
          // console.log(Author); 
          
           
            
        })
    }
     useEffect(() => {
        getAuthor()
    }, [])
  return (
      <div>{
      Author.map((item, i) => (
        <>
          <dt>
          <img key={i} src={item.avatar_url} className="img"></img>
          </dt><dd>{item.name}</dd>
          <p>{ item.label}</p>
          <p>{ item.introduce}</p>
        </>
        
             
      ))}</div>
  )
}
